{% extends 'rbac/base.html' %}
{% block addcss %}
    <link href="/static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="/static/css/plugins/select2/select2.min.css" rel="stylesheet">
    <link href="/static/css/plugins/iCheck/custom.css" rel="stylesheet">
    <style>
        .table-size {
            font-size: 13px;
        }


        .others a {
            margin-right: 5px;
        }

        .margin-btm-15 {
            margin-bottom: 15px;
        }
    </style>
{% endblock %}
{% block content %}
    {% load menu %}
    {#    {% breadcrumb request %}#}

    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>
                            {% with request.breadcrumb|last as last %}
                                {{ last.title }}
                            {% endwith %}
                        </h5>
                        <div class="ibox-tools">
                        </div>
                    </div>


                    <div class="ibox-content">
                        <form method="get" class="form-inline float-right margin-btm-15">
                            <div class="form-group">
                                <input type="text" placeholder="请输入搜索..." name="q" id="search-value"
                                       class="form-control" value="{{ search_value }}">
                            </div>
                            <button class="btn btn-success" type="submit" style="margin-left: 10px"><i
                                    class="fa fa-search"></i>搜索
                            </button>
                        </form>


                        {% csrf_token %}


                        <div class="table-responsive">

                            <table class="table table-striped table-bordered table-hover text-center table-size">
                                <thead>
                                <tr>
                                    {% for item in head_list %}
                                        <th>{{ item }}</th>
                                    {% endfor %}
                                </tr>
                                </thead>
                                <tbody>
                                {% for row in body %}
                                    <tr>
                                        {% for data in row %}
                                            <td>{{ data|safe }}</td>
                                        {% endfor %}
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>
                        {#                    分页表#}
                        <div class="col-sm-12 clearfix">
                            <ul class="pagination float-right">
                                {{ pager.page_html|safe }}
                            </ul>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block addjs %}
    <script src="/static/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="/static/js/plugins/iCheck/icheck.min.js"></script>
    <script src="/static/rbac/del.js"></script>
    <script src="/static/js/plugins/select2/select2.full.min.js"></script>
    <script>
        $(document).ready(function () {
            $(".mutli_select").select2({
                placeholder: "请选择批量操作",
                allowClear: true
            });
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
            });

            $("#check_all ").siblings().click(function () {
                if ($('#check_all').parent().hasClass('checked')) {
                    $('.i-checks div[class!="icheckbox_square-green checked"]').slice(1,).children('.iCheck-helper').click();
                } else {
                    $('.i-checks div[class*="checked"]').children('.iCheck-helper').click();
                }
            });
        })
    </script>

{% endblock %}
